Introduction to Git & GitHub

Session 1

Jennifer Graham
Tiago Silva
David Ryder

Friday, May 3, 2024

Welcome!

Some initial course info: ​

  • You can find links to our draft schedule and all our course materials through our wiki.​

    • https://github.com/CefasRepRes/Git_Training/wiki/Schedule​

    • We will take breaks during the day!

  • Feel free to interrupt and ask questions as we go. ​

  • H&S… ​

Why use version control?

  • How many people have directories that include files like this?

    • File_16062020.doc, File_30062020.doc, …
    • File_old.doc, File_new.doc
    • File.doc.orig
    • File.doc, File_test.doc

  • Version control allows you to:

    • Back up your code.

    • Keep track of changes.

    • Share your code with others.

    • Develop code with collaborators.

Changes are documented

  • As code is backed up, can be confident in testing new ideas.

  • Version control software ensures that changes are attributable to individuals.

    • If the code breaks, you know why!
  • Code can be shared along with the documentation and file history.

    • Documentation can explain how and why the code should be used.

    • Can create fixed versions/releases, along with DOIs.

      • Sharing now often required for publication.
  • All the above provides “quality assurance” in the final product.

Version control software

  • Many options out there…

  • Client-server model :: all users share a single code repository.

    • e.g., SVN (subversion)

      • Legacy choice, depending on when project started (many now switching)?
  • Distributed model :: all users have their own local repositories. Changes can be shared/merged as a separate step.

    • e.g., Git

      • What we’re using today!

      • Well supported, large user community, e.g.,

“No other technology is as widely used as Git.”

From Stack Overflow user survey (2022)

Central vs Distributed workflow?


Centralised/client-server model (e.g., SVN)


Distributed model (e.g., Git) 👏

So, what are Git & GitHub?


NB. These are two different things


  • Git = version control software.

  • GitHub = web-based repository hosting service*.

i.e. Git is the software behind the GitHub web service.


You can use Git without GitHub. However, GitHub provides useful tools (especially for sharing your code).


* Other providers exist, but GitHub is the most popular, e.g.: